/*
 * utilities.h
 * Common utility classes and methods
 * Created on: 13 Feb, 2009
 * Author: suren
 */

#ifndef UTILITIES_H_
#define UTILITIES_H_

// #includes necessary for the project
#include<iostream>
#include<string>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
using namespace std;


/* System wide macros */
#define LET(x,a) typeof(a) x(a)
#define FOR(i,a,n) for(LET(i,a);i!=n;++i)
#define REP(i,n) FOR(i,0,n)

struct argand;
struct polar;

struct argand{
  double real,imaginary;
  argand();
  argand(double x,double y);
  argand(polar a);
  polar to_polar();
  double abs();
  double arg();
  argand conjugate();

};

struct polar{
  double abs,args;
  polar();
  polar(double a, double b);
  polar(argand a);
  argand to_argand();
  double real();
  double imaginary();
  polar conjugate();
};


#endif /* UTILITIES_H_ */
